package pers.qtong.tank;

import java.awt.*;

public class Explode extends GameObject{
    private int x;
    private int y;

    private int step;

    private static int WEIGHT = ResourceMgr.explodes[0].getHeight();
    private static int WIDTH = ResourceMgr.explodes[0].getWidth();

    public Explode(int x, int y) {
        this.x = x;
        this.y = y;
        GameModel.getInstance().add(this);
    }

    @Override
    public void paint(Graphics g) {
        g.drawImage(ResourceMgr.explodes[step++], x, y, null);

        if(step >= ResourceMgr.explodes.length) {
            GameModel.getInstance().remove(this);
        }
//        new Thread(()->new Audio("audio/explode.wav").play()).start();

    }
}
